package com.example.activity;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;

import com.example.Base.BasePersonActivity;
import com.example.administrator.olddoctor.R;
import com.example.tools.BitMap.GlideUtils;
import com.example.view.CircleImageView;

/**
 * 关注
 */
public class AttentionActivity extends BasePersonActivity implements View.OnClickListener{

    private Button is_attention;
    private ListView attention_listView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_attention);
        init();
    }

    private void init() {
        setActionBar(getResources().getDrawable(R.mipmap.call_back), null,"关注",null,null,null);
        attention_listView = (ListView) findViewById(R.id.attention_listView);
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.actionbar_left:
                finish();
                break;
        }
    }

    public void loadDate(){


    }

    class attentionAdapter extends BaseAdapter{

        @Override
        public int getCount() {
            return 0;
        }

        @Override
        public Object getItem(int position) {
            return null;
        }

        @Override
        public long getItemId(int position) {
            return 0;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {

            final MyHolder myHolder;
            if(null == convertView){
                myHolder = new MyHolder();
                convertView = LayoutInflater.from(AttentionActivity.this).inflate(R.layout.item_attention,parent,false);
                myHolder.user_image = (CircleImageView) convertView.findViewById(R.id.user_image);
                myHolder.user_name = (TextView) convertView.findViewById(R.id.user_name);
                myHolder.video_text = (TextView) convertView.findViewById(R.id.video_text);
                myHolder.topic_text = (TextView) convertView.findViewById(R.id.topic_text);
                myHolder.is_attention = (Button) convertView.findViewById(R.id.is_attention);
                is_attention.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        myHolder.is_attention.setText("已关注");
                        myHolder.is_attention.setEnabled(false);
                    }
                });
                convertView.setTag(myHolder);
            } else {
                myHolder = (MyHolder) convertView.getTag();
            }
            //等数据来后 直接加载即可

            return convertView;
        }

        class MyHolder{
            private com.example.view.CircleImageView user_image;
            private TextView user_name;
            private TextView video_text;
            private TextView topic_text;
            private Button is_attention;
        }
    }


}
